<extend name="Public:base" />



<block name="title">日历 - </block>



<block name="head">
<style>
.divtable{
	border-bottom:1px solid #CCC;
}
.divtable_tr{
	display: flex;
}
.td{
	flex:1;
	border-top: 1px solid #CCC;;
	border-right: 1px solid #CCC;
	line-height: 60px;
	text-align: center;
}
.td:first-child{
	border-left: 1px solid #CCC;
}
.active1{
	background: #337AB7;
}
.active0{
	background: #FF0000;
}
.active0 a,.active1 a{
	color:#FFF;
}
</style>
</block>



<block name="main">

	<div class="container">

<div class="row f16">
	<div class="col-xs-3">
		<a href="?year={$_GET.year}&month={$_GET.month}&go=prev"><i class="icon-circle-arrow-left"></i> 上月</a>
	</div>
	<div class="col-xs-6 tc">{$title}</div>
	<div class="col-xs-3 tr">
		<a href="?year={$_GET.year}&month={$_GET.month}&go=next">下月 <i class="icon-circle-arrow-right"></i></a>
	</div>
</div>


<div class="divtable">

	<div class="divtable_tr">

		<div class="td">Sun</div>
		<div class="td">Mon</div>
		<div class="td">Tue</div>
		<div class="td">Wed</div>
		<div class="td">Thu</div>
		<div class="td">Fri</div>
		<div class="td">Sat</div>

	</div>


<?php
//行
$now_day = 1;
//几行
for($i=0;$i<$row;$i++):
?>
	<div class="divtable_tr">
<?php
//七格
for($j=0;$j<7;$j++):

//激活格
if(isset($active_day[$now_day])){
	$bgcolor = ' active' . $active_day[$now_day];
	$url = '/main/book/year/' . $_GET['year'] . '/month/' . $_GET['month'] . '/day/' . $now_day . '/week/' . $j;
}
else{
	$bgcolor = '';
	$url = '#';
}

//月外格
if( ($i==0 && $j<$week_day) || $now_day > $total_day):
?>
		<div class="td">&nbsp;</div>
<?php
//今天
elseif(
$_GET ['year'] ==  date('Y') &&
$_GET ['month'] ==  date('m') &&
$now_day == date('d')):
?>
		<div class="td{$bgcolor}"><a href="{$url}">{$now_day++}</a></div>
<?php
//月内格
else:
?>
		<div class="td{$bgcolor}"><a href="{$url}">{$now_day++}</a></div>
<?php
endif;
?>

<?php
endfor;//七格
?>
	</div><!--tr-->
<?php
endfor;//行
?>
</div><!--table-->

<br>


</block>